Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move onboarding prompt to enable screen #2737

Merged
merged 20 commits into from
Sep 18, 2023
Merged

Conversation

reneaaron
Copy link
Contributor

@reneaaron reneaaron commented Sep 7, 2023

Describe the changes you have made in this PR

  • Have a separate enable screen for different providers (nostr, webbtc, liquid)
    • This will enable us to do further provider specific improvements (like permission presets, etc)
  • Get rid of all the content-script changes (no more api calls in there)
  • Enable screens would check for respective keys (nostr -> nostr, webbtc -> mnemonic, etc)

@rolznz rolznz mentioned this pull request Sep 8, 2023
6 tasks
@rolznz
Copy link
Contributor

rolznz commented Sep 8, 2023

@reneaaron I think this is a good idea. Would @pavanjoshi914 work on it?

@reneaaron
Copy link
Contributor Author

reneaaron commented Sep 8, 2023

@pavanjoshi914 After discussing this with @bumi we think it would be best to create separate enable screens (I've updated the issue description)

@pavanjoshi914 pavanjoshi914 marked this pull request as ready for review September 14, 2023 07:05
Copy link
Collaborator

@bumi bumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use different components for each enable screen that we can also adjust the content.
and on nostr talk about nostr
for liquid talk about liquid, etc.

if (fetchedAccount.nostrEnabled) {
setAccountComponent(<Enable origin={props.origin} />);
} else {
setAccountComponent(<Onboard />);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it good to set this as a state or should we do this in the render block depending on the state variables that is set?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now we return component directly based on the state variable

@@ -85,7 +85,7 @@ const routes = {
public: {
webbtc: {
onboard: onboard.prompt,
enable: allowances.enable,
enable: allowances.mnemonicEnable,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move those under the webbtc/nostr/etc. namespaces then we also indicated there that those are called from the window providers

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved enable prompts to their respective namespaces

@pavanjoshi914
Copy link
Contributor

let's use different components for each enable screen that we can also adjust the content. and on nostr talk about nostr for liquid talk about liquid, etc.

added separate component for each provider screen

@@ -4,7 +4,7 @@ import state from "~/extension/background-script/state";
import { allowanceFixture } from "~/fixtures/allowances";
import type { DbAllowance, MessageAllowanceEnable, Sender } from "~/types";

import enableAllowance from "../enable";
import enableAllowance from "../../webln/enable";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems wrong related to the filename. Now do we need tests for each provider?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what shall be do here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shall be not in allowance anymore. separate file in each provider?

modify contents in the screen
clean up blocklist, allowance and enable functions in the provider
signed-off-by: pavan joshi <pavanj914@gmail.com>
isUnlocked &&
allowance &&
allowance.enabled &&
account?.nostrPrivateKey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the nostrPrivateKey check needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's to force onboarding in the enable prompt, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed because if allowance is set we directly return from the prompt itself. we don't go to screen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to open enable screen and render screen conditionally

Copy link
Contributor

@rolznz rolznz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@rolznz rolznz merged commit c9e165d into master Sep 18, 2023
7 checks passed
@rolznz rolznz deleted the feat/onboarding-prompt branch September 18, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants